package me.aip.mov.service;

import me.aip.mov.entity.AccessUser;
import me.aip.mov.entity.UserInfo;
import me.aip.mov.response.ResponseResult;

import java.util.Map;

public interface IAuthService {
    /**
     * 获取Rsa公钥
     * @return
     */
    Map<String, String> getRsakey() throws Exception;
    /**
     * 手机号登录
     * @param accessUser
     * @return
     */
    UserInfo loginByPhone(AccessUser accessUser);

    /**
     * 解密
     * @param passwd
     * @param rsakey
     * @return
     */
    String getDecodePassword(String passwd, String rsakey);

    ResponseResult login(String userName, String passwd);

    ResponseResult loginByWx(String wxCode, String appId);

    ResponseResult loginByWxApplet(String wxCode, String appId, String encryptedData, String iv);

    ResponseResult loginByQQ(String openId, String unionid, String nickName, String city, String province, String headimgurl, String sex);

    ResponseResult loginByApple(String openId, String unionid, String nickName);

    ResponseResult getOpenInfo(String wxCode, String appId);

    ResponseResult getOpenInfoJS(String wxCode, String appId);

    boolean validateSmsCode(String tel, String smsCode);

    ResponseResult creatUserByWx(String tel, String wxCode, String source);

    ResponseResult loginBySms(String tel);

    ResponseResult creatUserByPhone(String tel, String passwd, String source);

    ResponseResult creatUserByUserName(String userName, String passwd, String source);

    ResponseResult forgetPassword(String tel, String passwd);

    ResponseResult changePassword(String userId, String passwd, String smsCode);

    void outLogin(String token);

    ResponseResult sendSms(String tel);

    boolean validateCaptchaCode(String captchaCode);
}
